###################################################
README File for replications materials: 

Paper title: ''Discounting extreme positions: Party normalization and support for the far right,'' Political Science Research and Methods

Authors: Laia Balcells, Sergi Martínez, and Ethan vanderWilden
Corresponding Author: Ethan vanderWilden (ethan.vanderwilden@wisc.edu)
Date: November 26, 2024

###################################################
Overview: 

This replication folder contains all necessary components to reproduce results from above titled paper. This README file include information on:
 - Description of Software Command Files (R scripts)
 - Data and organization
 - Computing Environment
 
* When replicating the analysis, working directories may need to be changed to correctly locate data (SAV) files
* Tabular outputs appear in the R console environment as Latex tables
* Figure outputs appear in the 'plots' window of the R studio environment and can be saved from there (dimensions noted in comments)

###################################################
Description of Software Command Files (R Scripts):

Our entire analysis is contained to the single file titled ''DiscountingAnalysis.R''. The file begins by specifying 4 ''helper functions'' that avoid for repetition in coding. It then shows all code used to reproduce figures and numerical estimates shown in the main text. The final section of the file shows all commands needed to reproduce results (tables and figures) shown or discussed in the online appendix.

###################################################
Data and organization: 

The main analysis is done with an original dataset collected by the authors. The file is titled "DiscountingData.sav". It is accompanied by a codebook, which explains each variable ("codebook_discountin_data.pdf")

We also perform additional analyses using Manifesto project data ("additional_data/MPDataset_MPDS2023a_stat14.dta") and data from the Spanish Centro de Investigaciones Sociológicas ("additional_data/cis2023sept3420.sav"). Further information for either dataset can be found at their websits.

###################################################
Computing Environment:

 - Analyses were run using R version 4.4.1
 - Analyses were primarily built with Windows version 11 (using an AMD Ryzen 5 5500U processor with a 64-bit operating system) and replicated in an R environment using MacOS version 12.6
 - Code to install and load relevant R packages are included in the ''DiscountingAnalysis.R'' file. Packages include: "tidyverse" (version 2.0.0), "dplyr" (version 1.1.2), "gridExtra" (version 2.3), "haven" (version 2.5.4), "modelsummary" (version 2.1.1), "mediation" (version 4.5.0), Hmisc (version 5.1-3), "collapse" (version 2.0.15), "datawizard" (version 0.12.2),  "patchwork" (version 1.2.0), "kableExtra" (version 1.4.0), and "vtable" (version 1.4.7).

###################################################

